Standardize scalar function array construction - #9135
Draft
connortsui20 wants to merge 1 commit into
Draft
Conversation
Member
Author
|
Still need to figure out if there is a way to make the generic factor ext trait able to express more complicated validation logic as in |
connortsui20
force-pushed
the
ct/scalar-fn-factory-ext
branch
from
August 2, 2026 00:53
48d2bcc to
ce52f49
Compare
connortsui20
force-pushed
the
ct/scalar-fn-factory-ext
branch
from
August 2, 2026 18:03
ce52f49 to
bf43ecf
Compare
connortsui20
force-pushed
the
ct/l2-denorm-encoding
branch
3 times, most recently
from
August 3, 2026 15:42
8598018 to
780d4d0
Compare
connortsui20
force-pushed
the
ct/scalar-fn-factory-ext
branch
from
August 3, 2026 15:57
bf43ecf to
8f10bf2
Compare
connortsui20
marked this pull request as ready for review
August 3, 2026 16:53
gatesn
requested changes
Aug 3, 2026
Member
Author
|
Ok so it seems like we need to delete the scalar function factory ext |
connortsui20
force-pushed
the
ct/scalar-fn-factory-ext
branch
from
August 3, 2026 19:56
8f10bf2 to
0a92c58
Compare
Uses `ScalarFnFactoryExt` for tensor and geo scalar functions instead of maintaining per-function constructors. `L2Denorm` keeps its checked constructor because it validates the normalized-row invariant. Signed-off-by: "Connor Tsui" <connor.tsui20@gmail.com>
connortsui20
force-pushed
the
ct/scalar-fn-factory-ext
branch
from
August 3, 2026 20:35
0a92c58 to
4363c00
Compare
connortsui20
marked this pull request as draft
August 3, 2026 20:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(semi-related) Tracking Issue: #9129
Right now the tensor and geo scalar functions maintain bespoke inherent constructors alongside
ScalarFnFactoryExt::try_new_array. This removes the redundant constructors and migrates the in-tree callers to the shared factory API.Note that this intentionally removes public
new()andtry_new_array(...)methods fromCosineSimilarity,InnerProduct, andL2Norm, plustry_new_array(...)from the four geo scalar functions. This is a source compatibility break, which is why I split it out from the RowFn work and left the PR as a draft. The main review question is whether the smaller and consistent API is worth that break, or whether these should remain as forwarding methods.Normalizedused to be the awkward exception here: its constructors enforce or explicitly bypass the normalized-row invariant, which the generic factory cannot express. That turned out to be a sign it was never a scalar function in the first place, so it moves to a dedicated array encoding in #9138 and is no longer part of this diff.